from selenium.webdriver.common.by import By

from common.Utils import BolgDriver

class LogOut:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "http://8.137.19.140:9090/blog_detail.html?blogId=24713"
        self.driver = BolgDriver.driver
        self.driver.get(self.url)
    def LogOutTest(self):
        # 点击右上角的“注销”按钮
        self.driver.find_element(By.CSS_SELECTOR,"body > div.nav > a:nth-child(6)").click()
        # 如果当前页面的网址是登陆界面的网址，说明注销成功
        curUrl=self.driver.current_url
        assert curUrl=="http://8.137.19.140:9090/blog_login.html"
